<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
<%
	String bathPath = request.getContextPath();
	pageContext.setAttribute("bathPath", bathPath);
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>增加控制器</title>
<link rel="stylesheet" href="${bathPath}/frame/layui/css/layui.css">
<link rel="stylesheet" href="${bathPath}/frame/static/css/style.css">
<link rel="icon" href="${bathPath}/frame/static/image/code.png">
<link type="text/css" rel="stylesheet" href="${bathPath}/css/page.css"/>
<script type="text/javascript" src="${bathPath}/js/jquery-1.9.1.min.js" ></script>
<script type="text/javascript" src="${bathPath}/js/ajaxSessionOut.js" ></script>

<!-- layer -->
<link type="text/css" rel="stylesheet" href="${bathPath}/js/layer/skin/layer.css"/>
<script type="text/javascript" src="${bathPath}/js/layer/layer.js" ></script>

<!-- validation -->
<script type="text/javascript" src="${bathPath }/js/jquery-validation/jquery.validate.js"></script>
<script src="${bathPath }/js/quickui/libs/js/form/validationRule.js" type="text/javascript"></script>
<script src="${bathPath }/js/quickui/libs/js/form/validation.js" type="text/javascript"></script>
<script src="${bathPath}/frame/layui/layui.js" charset="utf-8"></script>
<style type="text/css">
	.my-skin .layui-layer-btn a {
	background-color:#009688;
}
</style>

<script type="text/javascript">
function saveBtu(){
	var param=$("form").serialize();
	//layer.confirm("保存成功", {btn: ['确定'], title: "提示",skin:"my-skin"}, function(){
		$.ajax({
			 type:"POST",
			 async:false,
			 dataType:"text",
			 data:param,
		     url:"${bathPath}/aDKController/Controlleradd.action",
		     success:function(data){
		    	/*if(data!="SUCCESS"){layer.msg(data);}*/
					layer.confirm("保存成功！", {btn: ['确定'], title: "提示",skin:"my-skin"}, function(){
						parent.layer.close(parent.layer.index);
						parent.location.reload(); 
					});
		     }
		 });
		//layer.close(layer.index);
		//window.parent.location.reload(); 
	//}); 
	
}

</script>
<script type="text/javascript">
layui.use('form', function(){
	var form = layui.form(); 
	form.render();
	});
</script>
</head>
<body class="body">
<form class="layui-form layui-form-pane"  id="myform" method="post" action="" showOnMouseOver="false">
	<input type="hidden" id="autoId" name="autoId" value="${deptBean.autoId}">
	<table class="param_table">
		<tr>
			<td style="width:250px; padding:3px;">
				<div class="layui-form-item">
       				<label class="layui-form-label" style="width:120px;">名称：</label>
       				<div class="layui-input-inline">
            			<input type="text" id="location" name="location" value="" lay-verify="required" class="layui-input">
            		</div>
            	</div>
            </td>
		</tr>
		<tr>
			<td style="width:250px; padding:3px;">
				<div class="layui-form-item">
       				<label class="layui-form-label" style="width:120px;">IP地址：</label>
       				<div class="layui-input-inline">
            			<input type="text" id="iP" name="iP" value="" lay-verify="required" class="layui-input">
            		</div>
            	</div>
            </td>
		</tr>
		<tr >
			<td style="width:250px; padding:3px;">
				<div class="layui-form-item">
       				<label class="layui-form-label" style="width:120px;">端口号：</label>
       				<div class="layui-input-inline">
            			<input type="text" id="port" name="port" value="" lay-verify="required" class="layui-input">
            		</div>
            	</div>
            </td>
		</tr>
		<tr >
			<td style="width:250px; padding:3px;">
				<div class="layui-form-item">
       				<label class="layui-form-label" style="width:120px;">密码：</label>
       				<div class="layui-input-inline">
            			<input type="password" id="password" name="password"  value="" lay-verify="required"  class="layui-input">
            		</div>
            	</div>
            </td>
		</tr>
		<tr >
			<td style="width:250px; padding:3px;">
				<div class="layui-form-item">
       				<label class="layui-form-label" style="width:120px;">控制器类型设备：</label>
       				<div class="layui-input-inline">
            			<!-- <input type="password" id="password" name="password"  value="" lay-verify="required"  class="layui-input"> -->
            			<select id="type" name="type" lay-verify="required"  autocomplete="off" class="layui-input">
            			<%-- <option value="${u.nation}"></option> --%>
            			<option value="-1">---请选择---</option>
				        <option value="ADK972-1" >ADK972-1</option>
				        <option value="ADK972-2" >ADK972-2</option>
				        <option value="ADK972-4" >ADK972-4</option>       			
            			</select>
            		</div>
            	</div>
            </td>
		</tr>
			<td style="border:0;">
				<input class="layui-btn site-demo-active layui-btn-sm" style="margin-left:185px;" type="button" onclick="saveBtu()" value="保 存"  class="primary"/>
            </td>
		</tr>
	</table>
	</form>
</body>
</html>